﻿{include file="common/head"/}
<style type="text/css">
    #user_wallet .list-item .hanging-body {
        font-size: .65rem;
        padding: 0 .5rem;
        color: #6e6e6e
    }

    #user_wallet .list-item .hanging-body .wrap {
        white-space: normal;
        word-break: break-word
    }

    #user_wallet .list-item .hanging-body span {
        display: inline-block
    }
    #main {
        position:absolute;
        left:0px;
        right:0px;
        overflow:auto;
    }
</style>
<body>
<div class="page" id="user_wallet">
    {include file="common/loginHead"/}
    
    <div class="content transfer-content">
        <div class="transfer-title">
            <div class="transfer-round"><img src="/static/xigu/picture/ellipse.png"></div>
            <div class="transfer-text"><span render="name">您的钱包余额</span>：<span render="ye">0.00</span></div>
            <div class="clx"></div>
        </div>
        <div class="list-block content infinite-scroll" style="margin-top: 4.5rem" id="main">
            <div class="section " style="background-color: #fff;" id="buyorder">
           <!--     {volist name="lists" id="v"}
                <div class="list-item bottom-line">
                    <div class="hanging" style="align-items:center" >
                        <div class="hanging-body ellipsis">
                            <div class="wrap">
                                <div><span>{$v.time|date="Y=m=d H:i:s"}</span>&emsp;
                                    {if $v.source==12}
                                    <span style="float: right" class="color-success">{$v.num}</span>
                                    {else/}
                                    <span style="float: right" class="color-danger">{$v.num}</span>
                                    {/if}
                                </div>
                                <div><span>{$v.beizhu}</span></div>
                            </div>
                        </div>
                    </div>
                </div>
                {/volist}-->
            </div>
            <div class="infinite-scroll-preloader">
                <div class="infinite-scroll-preloader" id="jiazai" style="display: none;"><div class="preloader"></div></div>
                <fieldset style="border: none;border-top: 1px solid #e8e8e8 ;margin: 0 20px; "><legend style="padding: 0 10px" id="bottom">已经到底了</legend></fieldset>
            </div>
        </div>
    </div>
    
</div>
<script type="text/javascript">
    var base_url = 'http://www.jiaoyi.com/',sellid=0,off_on= true;
</script>
<script type='text/javascript' src='/static/xigu/js/jquery-3.3.1.min.js' charset='utf-8'></script>
<script type='text/javascript' src='/static/xigu/js/light7.min.js' charset='utf-8'></script>
<script type='text/javascript' src='/static/xigu/js/light7-swiper.min.js' charset='utf-8'></script>
<script type='text/javascript' src='/static/xigu/js/light7-swipeout.js' charset='utf-8'></script>
<script type='text/javascript' src='/static/xigu/js/cn.min.js' charset='utf-8'></script>
<script type='text/javascript' src='/static/xigu/js/layui.js' charset='utf-8'></script>
<script type='text/javascript' src='/static/xigu/js/basis.js' charset='utf-8'></script>
</body>

<script type="text/javascript">

    $('#main').scroll(function() {
        //当时滚动条离底部60px时开始加载下一页的内容
        if (($(this)[0].scrollTop + $(this).height() + 60) >= $(this)[0].scrollHeight) {

            //这里用 [ off_on ] 来控制是否加载 （这样就解决了 当上页的条件满足时，一下子加载多次的问题啦）
            if (off_on) {
                off_on = false;
                getbuy()
                //page++;
                //console.log("第"+page+"页");
                //LoadingDataFn();  //调用执行上面的加载方法
            }
        }
    });
    function getbuy(){
        $.ajax({
            type:'post',
            url : "{:url('getforce_wallet')}",
            data:{num:sellid},
            cache:false,
            dataType:'JSON',
            success:function(data){
                console.log(data)
                sellid++
                if(data.length != 0){
                    var html = '';
                    $.each(data,function(index, el) {
                        var moneytrue = el.types ==1 ? el.money:0;
                        html += '<div class="list-item bottom-line" >'
                                +    '<div class="hanging" style="align-items:center">'
                                +      '<div class="hanging-body ellipsis">'
                                +			'<div class="wrap">'
                                +			'<div><span>'+el.time+'</span>'
                                +				'<span style="float: right" class="'+el.color+'">'+el.num+'</span>'
                                +			'</div>'
                                +		'</div>'
                                +	  '<div><span>'+el.beizhu+'</span></div>'
                                +   '</div>'
                                +  '</div>'
                                +  '</div>'
                    });
                    if(data.length<12){
                        console.log(1)
                        $('#jiazai').hide();
                        $('#bottom').show();
                    }else{
                        console.log(data.length)
                        $('#jiazai').show();
                    }
                    off_on = true;
                    $('#buyorder').append(html);
                }else{
                    webToast('没有啦');
                }
            },
            error:function(e){
                webToast('没有啦');
            },
            beforeSend:function(e){

            }
        });

    }
</script>
<script type="text/javascript">
    $(function(){
        getbuy()
    })
</script>
</html>
